"""
通过is_enabled()判断元素是否可用
判断元素是否选中
"""
import time
from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.maximize_window()
driver.get("https://sahitest.com/demo/clicks.htm")

element1 = driver.find_element(By.XPATH, "/html/body/form/input[5]")
element2 = driver.find_element(By.XPATH, "/html/body/form/input[6]")
print(element1.is_enabled())  # 判断属性是否可用
print(element2.is_enabled())  # 判断属性是否可用
print(element2.is_selected())  # 判断元素是否选中 是true 否未false
element2.click()
print(element2.is_selected())
